<?php $this->load->view('navmenu');?>
<script type="text/javascript" charset="utf-8">
    // dynamic table
    jQuery('#dyntable').dataTable({
    "sPaginationType": "full_numbers",
    "aaSortingFixed": [[0,'asc']],
    "fnDrawCallback": function(oSettings) {
    jQuery.uniform.update();
    }
    });
</script>
<div class="maincontent">
        	<div class="contentinner">
                	<center><?php echo $this->session->flashdata('msg'); ?></center>
             <h4 class="widgettitle nomargin shadowed">Tambah Pejabat</h4>
                <div class="widgetcontent bordered shadowed nopadding">
                    <form class="stdform stdform2" method="post" action="<?php echo base_url()?>index.php/pejabat/savePejabat">
			    <p>
                                <label>Kode</label>
                                <span class="field"><input type="text" name="kode" class="input-xlarge" <?php if($selectedPejabat != ""){ echo 'value="'.$selectedPejabat['kode'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Kode PT</label>
                                <span class="field"><input type="text" name="kodept" class="input-xlarge" <?php if($selectedPejabat != ""){ echo 'value="'.$selectedPejabat['kodept'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Uraian</label>
                                <span class="field"><input type="text" name="uraian" class="input-xlarge" <?php if($selectedPejabat != ""){ echo 'value="'.$selectedPejabat['uraian'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Nama</label>
                                <span class="field"><input type="text" name="nama" class="input-xlarge" <?php if($selectedPejabat != ""){ echo 'value="'.$selectedPejabat['nama'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Periode Awal</label>
                                <span class="field"><input type="text" name="periode_awal" class="input-xlarge" <?php if($selectedPejabat != ""){ echo 'value="'.$selectedPejabat['periode_awal'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Periode Akhir</label>
                                <span class="field"><input type="text" name="periode_akhir" class="input-xlarge" <?php if($selectedPejabat != ""){ echo 'value="'.$selectedPejabat['periode_akhir'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Keterangan</label>
                                <span class="field"><textarea name="keterangan" class="input-xlarge"> <?php if($selectedPejabat != ""){ echo $selectedPejabat['keterangan']; }?></textarea></span>
                            </p>
                                                    
                            <p class="stdformbutton">
                                <button type="submit" class="btn btn-primary">Submit Button</button>
                                <button type="reset" class="btn">Reset Button</button>
                            </p>
                        </form>
                    </div><!--widgetcontent-->
            	<h4 class="widgettitle">Daftar User</h4>
            	<table class="table table-bordered" id="dyntable">
                    <thead>
                        <tr>
                            <th class="center">No</th>
                            <th class="center">Kode</th>
                            <th class="center">Kode PT</th>
                            <th class="center">Uraian</th>
                            <th class="center">Nama</th>
                            <th class="center">Periode Awal</th>
                            <th class="center">Periode Akhir</th>
                            <th class="center">Keterangan</th>
                            <th class="center">Action</th>
                        </tr>
                    </thead>
                    <tbody>
					<?php $i=1;?>
					<?php foreach($pejabats as $row):?>
                        <tr class="gradeX">
                            <td class="center"><?=$i?></td>
                            <td class="center"><?=$row['kode']?></td>
                            <td class="center"><?=$row['kodept']?></td>
                            <td class="center"><?=$row['uraian']?></td>
                            <td class="center"><?=$row['nama']?></td>
                            <td class="center"><?=$row['periode_awal']?></td>
                            <td class="center"><?=$row['periode_akhir']?></td>
                            <td class="center"><?=$row['keterangan']?></td>
                            <td class="center"><a href="<?php echo base_url();?>index.php/pejabat/pejabatsList/<?=$row['kode']?>"/><i class="icon-edit"></i></a> | <a href="<?php echo base_url();?>index.php/pejabat/deletePejabat/<?=$row['uraian']?>/<?=$row['kode']?>"><i class="icon-remove"></i></a></td>
                        </tr>
					<?php $i++;endforeach; ?>
                    </tbody>
                </table>
       
            </div><!--contentinner-->
        </div><!--maincontent-->